/*******************************************************************************
 * Copyright (c) 2005, 2014 springx.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.springx.examples.showcase.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class StoryController extends  BaseController{

	@RequestMapping(value = "/story/{page}")
	public String story(@PathVariable("page") String page,Model model) {
		if("web".equals(page)){
			model.addAttribute(CRUMBS_ATTRIBUTE, buildCrumbsMap(null,"独立演示","WEB演示"));
		}else if("webservice".equals(page)){
			model.addAttribute(CRUMBS_ATTRIBUTE, buildCrumbsMap(null,"独立演示","WEBSERVICE演示"));
		}else if("log".equals(page)){
			model.addAttribute(CRUMBS_ATTRIBUTE, buildCrumbsMap(null,"独立演示","日志演示"));
		}else if("redis".equals(page)){
			model.addAttribute(CRUMBS_ATTRIBUTE, buildCrumbsMap(null,"演示说明","REDIS演示"));
		}
		return "story/" + page;
	}
}
